using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class OH_ItemActivityMap : EntityTypeConfiguration<OH_ItemActivity>
    {
        public OH_ItemActivityMap()
        {
            // Primary Key
            this.HasKey(t => t.TransactionID);

            // Properties
            this.Property(t => t.Item)
                .HasMaxLength(10);

            this.Property(t => t.Location)
                .HasMaxLength(3);

            this.Property(t => t.DocumentType)
                .HasMaxLength(30);

            this.Property(t => t.DocumentID)
                .HasMaxLength(20);

            // Table & Column Mappings
            this.ToTable("OH_ItemActivity");
            this.Property(t => t.TransactionID).HasColumnName("TransactionID");
            this.Property(t => t.Item).HasColumnName("Item");
            this.Property(t => t.ExpiryDate).HasColumnName("ExpiryDate");
            this.Property(t => t.Qty).HasColumnName("Qty");
            this.Property(t => t.Location).HasColumnName("Location");
            this.Property(t => t.DocumentDate).HasColumnName("DocumentDate");
            this.Property(t => t.DocumentType).HasColumnName("DocumentType");
            this.Property(t => t.DocumentID).HasColumnName("DocumentID");
        }
    }
}
